Skip to content

Comments

fix(cli): replace skill installer script with init command#236

Merged
cameroncooke merged 4 commits intomainfrom
fix/init-distribution-compat
Feb 22, 2026
Merged

fix(cli): replace skill installer script with init command#236
cameroncooke merged 4 commits intomainfrom
fix/init-distribution-compat

Conversation

@cameroncooke
Copy link
Collaborator

Summary

  • replace the standalone scripts/install-skill.sh flow with a built-in xcodebuildmcp init command
  • update CLI wiring/help/docs validation and docs references for the new init command
  • make init distribution-safe by resolving skills from resource root and including skills/ in portable packaging
  • harden uninstall behavior and add init command test coverage

Key changes

  • add src/cli/commands/init.ts and tests in src/cli/commands/__tests__/init.test.ts
  • register init in src/cli.ts early dispatch and src/cli/yargs-app.ts help/discovery
  • add init to scripts/check-docs-cli-commands.js
  • remove stale installer rewrite logic from scripts/release.sh
  • update README.md and docs/MIGRATION_V2.md to use xcodebuildmcp init
  • include and verify skills/ in portable packaging scripts

Validation

  • npm run build
  • npm run lint (existing warnings in src/daemon.ts, no errors)
  • npm run format:check
  • npm run typecheck
  • npm test
  • npm run docs:check
  • local distribution smoke tests:
    • npm package install + xcodebuildmcp init --print
    • portable build + verify script (including init --print)
    • local Homebrew tap install + brew test + init --print

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/getsentry/XcodeBuildMCP/xcodebuildmcp@236

commit: c6c83ac

@cameroncooke
Copy link
Collaborator Author

Addressed in 9121d78.\n\n- Replaced redundant with so it now carries user-facing labels.\n- Labels now match intent from the old installer flow:\n - -> \n - -> \n- Updated init command tests to assert the new output strings.

@cameroncooke
Copy link
Collaborator Author

Correction: previous comment formatting was mangled by shell interpolation.

Addressed in 9121d78.

  • Replaced redundant skillLabel with skillDisplayName so it now carries user-facing labels.
  • Labels now match intent from the old installer flow:
    • mcp -> XcodeBuildMCP (MCP server)
    • cli -> XcodeBuildMCP CLI
  • Updated init command tests to assert the new output strings.

@cameroncooke
Copy link
Collaborator Author

Fixed in 99828a1.

What changed:

  • resolveTargets is now operation-aware (install vs uninstall).
  • For --uninstall with auto-detect and no clients, it now returns an empty target list instead of throwing.
  • This allows the handler to reach and print the graceful message: No installed skill directories found to remove.
  • Root destination guard text is now neutral: Refusing to use filesystem root as skills destination... (not install-specific).

Also added test coverage for uninstall with no auto-detected clients.

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment on lines +77 to +80
if (earlyCommand === 'init') {
await runInitCommand();
return;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The init command is dispatched via runInitCommand() before initSentry() is called, so any errors thrown during initialization will not be reported to Sentry.
Severity: MEDIUM

Suggested Fix

Call initSentry({ mode: 'cli' }) at the beginning of the runInitCommand() function. This will ensure that Sentry is initialized before the command logic is executed, allowing it to capture any subsequent errors, similar to the pattern used in startMcpServer().

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/cli.ts#L77-L80

Potential issue: The `init` command is dispatched early via `runInitCommand()` at
`src/cli.ts:77-80`, which bypasses the main Sentry initialization on line 81. Unlike
other commands, `runInitCommand()` does not call `initSentry()` itself. As a result, any
errors thrown during the `init` process (e.g., due to file system issues, missing skill
sources, or user cancellation) will propagate up to the main `catch` block without being
captured by Sentry. This creates a monitoring blind spot for a critical user onboarding
command, preventing developers from being alerted to production failures.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for flagging this. I reviewed the flow and agree there is a small observability gap: init is dispatched before initSentry({ mode: "cli" }), so fatal init-path errors won’t have full Sentry initialization.\n\nThat said, this is low-risk and telemetry-only (it does not change command behavior), and we already print actionable errors to stderr and exit non-zero. Given current PR scope, I’m deferring this rather than expanding the change set.\n\nFollow-up option (if we choose to tighten telemetry): initialize Sentry before init dispatch (or call initSentry inside runInitCommand) and add explicit fatal capture in the top-level catch path.

@cameroncooke cameroncooke merged commit bfa9fef into main Feb 22, 2026
10 checks passed
@cameroncooke cameroncooke deleted the fix/init-distribution-compat branch February 22, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant